package com.example.springboot.dao;

import com.example.springboot.bean.Province;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

/**
 * Created by tang on 2018/3/11.
 */
@Mapper
public interface ProvinceMapper {


    //    @Select("select * from province,city where city.province_id=province.id and province_name=#{name}")
//    @Select("select * from province where province_name=#{name}")
//    @Results({@Result(column = "province.id", property = "id"),
//            @Result(column = "province_name", property = "provinceName"),
//            @Result(property = "cityList", column = "province.id",
//                    many = @Many(select = "com.example.springboot.dao.CityMapper.findByProvinceId", fetchType = FetchType.LAZY))})
    Province findByName(@Param("name") String name);

}
